<types>

Each node, and probably other things, should have a type.

An example of a type, summarized in english, is "first index is int array with size equal to size of array 5 power size of array 9".

Audivolv has 1 static array for the whole software.
Maybe that array should be an array of these type objects?

Should each index in that array be required to be an instance or a type but not both?
For example, a node's type would be the int index pointing at the type,
and the type's type would be at some other index.
The type of type means the constant-size data that describes what things are that type and what things are not.
The type of type would be the only thing whose type is itself.

What would be the java-type of a type?
If its a specific class (with public final vars maybe), then there is no type of type.
If its an Object array, then its a node, and is more consistent but a little slower.

Should int array, flo array, and Object array have their own index in Audivolv's main static array?

Should any instance have a read-only var in its type (probably final)?

What data structure should each instance use to specify its type?
Should it be an int array (points at type) and an Object array (instance) the same size.
The type (or the instance?) would need to store the Obfunc function Object that executes each instance in a thread-safe way.

Some final types would be supersets of other final types, but should that information be stored anywhere?
That could be viewed as multiple inheritance.


Should there be a type of int, and separately a type of int array (with specific size requirements), and separately a type of node containing int array at index 5 with specific size requirements?

Where to store the Obfuncs (or whever java object contains evolved code)? Each index in Audivolv's static main array has one of those functions, which may be shared between multiple indexs.

Should the Obfunc of an int return an Integer?
Should the Obfunc of a node (Object[]) return that node?
Should the Obfunc of a variable-size array return the same array if size not change and return a different array if size change?


Should primitive types, like int or double, have a type defined the same as a node type is defined, and define them as a constant size sequence of (32 or 64 in this case) bits? How to define a bit?

Need a different way to define Java types than define node types because Java types can not be created in terms of anything else.

Should there also be definitions for more abstract ideas like array, integerSize, integerSize multiply integerSize, integerSize power integerSize etc?

Should there be definitions of specific int and double values, for the purpose of putting min and max bounds on the inputs and outputs of functions that use double arrays.

How to make the sizes of some arrays depend on other arrays in the same node and some sizes depend on sizes of things outside the node in Audivolv's static main array?


Try to define type of boolean (also called bit):

theOnlyBooleanDef = Object[]{
	int[]{ uniqueIntOfTheOnlyBooleanDef }
	boolean[1]
}


Try to define type of int:

theOnlyIntDef = Object[]{
	int[]{ uniqueIntOfTheOnlyIntDef }
	boolean[32]
}


Try to define type of int array:

theOnlyIntArrayDef = Object[]{
	int[]{ theUniqueIntOfTheOnlyIntArrayDef }
	??????????????????
	Object[]{
		??????????????????
		theOnlyIntArrayDef
	}
}


Try to define a simple Obfunc in terms of these other things, but maybe those things dont fit together well:


Try to define type of a simple neural-node:



------------------------------------------
sizeOps examples:

x multiply y

x power y

x range y
//constant if x and y always evaluate to the same constant.
//variable if x can change and y always equals x, vice versa.





//How to make arrays in the same node depend on eachothers size instead of the sizes of prototypes in Audivolv's static main array?
//Maybe, if its a variable size definition, use the size in the node, else use that constant size.
//But how can 2 arrays in the same node be defined by the same variable size range, like 1 to 6?
//In some node definitions, both arrays should be the same size, and in other definitions,
//both arrays can be different sizes, both variable between 1 and 6.
//Possible partial solution: The first array is defined by the variable size, and the second must equal the size of the first.
//Object arraySizes...[need min, max, lvalue, rvalue, multiply, power, etc]

//sizeLvalues and sizeRvalues must be able to refer to what sizeLvalues and/or sizeRvalues contain.

//If a network has 5 unique node definitions and 9 unique array definitions,
//should 5+9=14 extra nodes be created so they can refer to eachother?
//But that does not explain how 2 instances of the same node type can
//have different array sizes (if that 1 of the 9 array definitions is variable size)
//and still depend on the correct node (the current node, child node, etc).
//Thats too complex.
//Instead, only allow array sizes to depend on arrays in the same node,
//(even if the same network has multiple array types) or depend on arrays in Audivolv's static main array.

simpleNeuralNodeDef = Object[]{
	int[]{ theUniqueIntOfSimpleNeuralNodeDef }
	Object arrayTypes[] //Example[x]: objectRepresentingBayesNodeType
	Object sizeOps[] //Example[x]: objectRepresentingThePowerFunction
	Object sizeLvalues[] //Example[x]: objectWithArraySize2
	Object sizeRvalues[] //Example[x]: objectRepresentingSizeBetween1And6
}

Object arrayTypes[]
//This contains node definitions. Example: simpleNeuralNodeDef.
//The array sizes in the node definition do not affect this node's array sizes.
//It only affects the types of nodes each instance of this node type contains.

Object sizeOps[]
//Always in Audivolv's static main array. I dont yet know how to define these functions, but that will be their location.

Object sizeLvalues[]
//This contains node definitions, and (probably) uses only the first size definition,
//which is (for each x, in sizeLvalues[x]): arrayTypes[0], sizeLvalues[0], sizeOps[0], and sizeRvalues[0],
//but maybe in a future design, it could use more than the first.
//???

Object sizeRvalues[]
//same as Object sizeLvalues[], but rvalue instead of lvalue.



Try to define type of type:

//this is the cycle type of type of type... and can not end in "type of simple neural node" etc.
typeOfType = Object[]{
	int[]{ theUniqueIntOfTypeOfType }
	Object arrayTypes[]{
		typeOfIntArray
		typeOfType
		typeOfType
		typeOfType
		typeOfType
	}
	Object sizeOps[]{
		nodeThatMeansIntegerSizeRange
		nodeThatMeansIntegerSizeRange
		nodeThatMeansIntegerSizeRange
		nodeThatMeansIntegerSizeRange
		nodeThatMeansIntegerSizeRange
	}
	Object sizeLvalues[]{
		nodeThatMeansTheConstant1
		nodeThatMeansTheConstant5
		nodeThatMeansTheConstant5
		nodeThatMeansTheConstant5
		nodeThatMeansTheConstant5
	}
	Object sizeRvalues[]{
		nodeThatMeansTheConstant1
		nodeThatMeansTheConstant5
		nodeThatMeansTheConstant5
		nodeThatMeansTheConstant5 //size is the range function of 5 and 5.
		nodeThatMeansTheConstant5
	}
}


Try to define type of simple bayesian node.
//Summary: Object[]{ int uniqueInt[1], Object bayesChilds[x], flo bayesWeight[2 power x] }

//this is the cycle type of type of type... and can not end in "type of simple neural node" etc.
typeOfSimpleBayesNode = Object[]{
	int[]{ theUniqueIntOfTypeOfSimpleBayesNode }
	Object arrayTypes[]{
		typeOfIntArray
		typeOfArrayOfSimpleBayesNode
		typeOfFloArray
	}
	Object sizeOps[]{
		nodeThatMeansIntegerSizeRange
		nodeThatMeansIntegerSizeRange
		nodeThatMeansIntPowerFunc
	}
	Object sizeLvalues[]{
		nodeThatMeansTheConstant1
		nodeThatMeansTheConstant0
		nodeThatMeansTheSize2ListOfBayesFalseAndBayesTrue
	}
	Object sizeRvalues[]{
		nodeThatMeansTheConstant1
		nodeThatMeansTheConstant6
		typeOfArrayOfSimpleBayesNode
	}
}

nodeThatMeansTheConstant6 = Object[]{ //this is constant 6 and the type flo array, a flo array size 6
	int[]{ theUniqueIntOfTypeOfNodeThatMeansTheConstant6 }
	Object arrayTypes[]{
		typeOfIntArray
		typeOfFloArray
	}
	Object sizeOps[]{
		nodeThatMeansConstantIntegerSizeRange
		nodeThatMeansConstantIntegerSizeRange
	}
	Object sizeLvalues[]{
		Object[1]
		Object[6]
	}
	Object sizeRvalues[]{
		Object[1]
		Object[6]
	}
}


</types>